<div class="form-group" style="display:none;">
	<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">商品标签</label>
	<div class="col-md-6">
		<input type="text" name="goods[goodstab]" class="form-control" value="{$goods['goodstab']}" />
	</div>
</div>
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">服务时间</label>
	<div class="col-md-9">
		<table class="table table-hover">
			<thead>
			<tr>
				<th style='width:50px;'></th>
				<th>起始时间(如：09 表示9点)</th>
				<th>截止时间（如:11 表示11点）</th>
			</tr>
			</thead>
			<tbody id="param-items">
				{loop $params $p}
				<tr>
					<td>
						<a href="javascript:;" class="fa fa-move" title="拖动调整此显示顺序"><i class="fa fa-arrows"></i></a>&nbsp;
						<a href="javascript:;" onclick="deleteParam(this)" style="margin-top:10px;" title="删除"><i class='fa fa-remove'></i></a>
					</td>
					<td>
						<input name="param_title[]" type="text" class="form-control param_title" value="{$p['title']}"/>
						<input name="param_id[]" type="hidden" class="form-control" value="{$p['id']}"/>
					</td>
					<td><input name="param_value[]" type="text" class="form-control param_value" value="{$p['value']}"/></td>
				</tr>
				{/loop}
			</tbody>
			<tbody>
				<tr>
					<td colspan="3">
						<a href="javascript:;" id='add-param' onclick="addParam()" style="margin-top:10px;"  title="添加属性">添加属性 <i class='fa fa-plus'></i></a>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>

<script language="javascript">
	$(function(){
		$("#chkoption").click(function(){
			var obj =$(this);
			if(obj.get(0).checked){
				$("#tboption").show();
				$(".trp").hide();
			}
			else{
				$("#tboption").hide();
				$(".trp").show();
			}
		});
	})
	function addParam() {
		var url = "{php echo web_url('goods/param')}";
		$.ajax({
			"url": url ,
			success:function(data){
				$('#param-items').append(data);
			}
		});
		return;
	}
	function deleteParam(o) {
		$(o).parent().parent().remove();
	}
</script>